<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .A .C{color:green}
        .A .B. C{color:red}
        #A div{color: blue}
        #A #B div{color: aqua}

        div{color: brown!important;
        }
       span{

       }

    </style>
</head>
<body>
<div class="A">
    <div class="B">
        <div class="C">
            嵌套优先级
        </div>
    </div>
</div>
<div id="A">
    <div id="B">
        <div id="C">
            嵌套优先级
        </div>
    </div>
</div>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>


</body>
</html>